#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPixmap>
#include <QBitmap>
#include <QDebug>
#include <QQmlApplicationEngine>
#include <QMultimedia>
#include <QQuickWindow>
#include <QZXing.h>
#include <QTcpSocket>
#include <QThread>


namespace Ui {
class Widget;
}


class Gemini : public QWidget
{
        Q_OBJECT
        Ui::Widget *recv;
    public:
        explicit Gemini(QWidget *parent = nullptr);
        Q_INVOKABLE void getValFromQml(int v);
        void run();
        QTcpSocket *socket;
        QThread mythread;
        ~Gemini();

public slots:
        void threadExit();
        void connectedSlot();
        void disconnectedSlot();
        void recvDataSlot();

    signals:
       void valueFromCpp(int val);
       void threadDone();
       void recvData();

private slots:

};


class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = nullptr);
    void displaystr000(QString str);
    QTcpSocket *socket;
    QThread mythread;
    ~Widget();
    Ui::Widget *ui;
    Gemini gim;




private slots:
    void on_open_btn_clicked();
    void on_recv_btn_clicked();

private:

    QPixmap pix;
    QQmlApplicationEngine engine;
    QQuickWindow *window;
    QObject *qob;
signals:
    void valueFromCpp(int val);
};



#endif // WIDGET_H
